<template>
    <div>
        <a-modal
            title="打印人员信息"
            :visible="visible"
            @ok="visible = false"
            @cancel="visible = false"
            :footer="null"
            :width="850"
        >
            <div>
                <a-button class="blue-btn" v-print="printObj" type="primary" icon="printer">打印</a-button>
            </div>
            <div id="lxryPrin-box-v">
                <div style="text-align: center;">
                    <h2 style="font-weight: 600;">{{ name }}</h2>
                </div>
                <table border style="width: 100%;text-align: center;font-size: 16px;border-color: #666;" >
                    <tr>
                        <th style="width: 65px;">姓&nbsp;&nbsp;&nbsp;&nbsp;名</th>
                        <th style="width: 65px;">性&nbsp;&nbsp;&nbsp;&nbsp;别</th>
                        <th>工作单位</th>
                        <th style="width: 65px;">分&nbsp;&nbsp;&nbsp;&nbsp;数</th>
                        <th style="width: 90px;">考核结果</th>
                    </tr>
                    <tr v-for="(item,index) in ryList" :key="index">
                        <td>
                            <span v-if="item.realname.length>2">{{ item.realname }}</span>
                            <span v-else style="display: flex;justify-content: space-between;">
                                <span v-for="(trem,tIndex) in item.realname.split('')">{{ trem }}</span>
                            </span>
                        </td>
                        <td>{{ item.sex == '1'?'男':'女' }}</td>
                        <td>{{ item.fgzdw }}</td>
                        <td>{{ item.fksfs }}</td>
                        <td>{{ item.fkhjg }}</td>
                    </tr>
                </table>
            </div>
        </a-modal>
    </div>
</template>
<script>
import { jcylxjhprintLxryInZzqrmd, } from './service/index'
export default {
    components:{

    },
    props:{

    },
    data(){
        return{
            visible:false,
            ryList:[],
            printObj:{
                id:"lxryPrin-box-v", //需要打印的id名称
                popTitle:"宣传信息审批表",//文档的名称
                // preview:true,//预览功能，不好用
                zIndex:'20002',
                beforeOpenCallback(vue){
                    // //console.log('打印回调',vue)
                },
                openCallback (vue) {//打开之前
                    // //console.log('打开之前',vue)
                },
                closeCallback (vue) {//关闭了打印工具
                    // //console.log('关闭了打印工具')
                },
            },
            name:''
        }
    },
    watch:{

    },
    mounted(){
        
    },
    methods:{
        getData(row,name){
            this.name = name
            jcylxjhprintLxryInZzqrmd(row).then(res=>{
                if(res.code == 200){
                    this.ryList = res.result
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
    }
}
</script>
<style lang="less">
    #lxryPrin-box-v{
        th,td{
            padding: 5px 10px;
            // font-family: 宋体 !important;
        }
    }
</style>